<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
	<th:block th:include="include :: header('修改留言板评论互动')"/>
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-comments-edit" th:object="${comments}">
			<input name="commentsId" th:field="*{commentsId}" type="hidden">
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">评论标题：</label>
				<div class="col-sm-8">
					<input name="commentsTitle" th:field="*{commentsTitle}" class="form-control" type="text" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">评论类型：</label>
				<div class="col-sm-8">
					<select name="commentsType" class="form-control m-b"
					        th:with="type=${@dict.getType('sys_comments_type')}" required>
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
						        th:field="*{commentsType}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">评论内容：</label>
				<div class="col-sm-8">
					<input name="commentsContent" th:field="*{commentsContent}" class="form-control" type="text"
					       required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">评论目标用户编号：</label>
				<div class="col-sm-8">
					<input name="commentsToId" th:field="*{commentsToId}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">评论用户编号：</label>
				<div class="col-sm-8">
					<input name="commentsFromId" th:field="*{commentsFromId}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">评论状态：</label>
				<div class="col-sm-8">
					<div class="radio-box" th:each="dict : ${@dict.getType('sys_news_status')}">
						<input type="radio" th:id="${'status_' + dict.dictCode}" name="status"
						       th:value="${dict.dictValue}" th:field="*{status}" required>
						<label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<input name="remark" th:field="*{remark}" class="form-control" type="text">
				</div>
			</div>
        </form>
    </div>
	<th:block th:include="include :: footer"/>
    <script th:inline="javascript">
        var prefix = ctx + "admin/comments";
        $("#form-comments-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-comments-edit').serialize());
            }
        }
    </script>
</body>
</html>